package com.yq.day26;

import java.io.*;
import java.util.Calendar;

/**
 * @author 3307235355@qq.com
 * @since 2022/06/26 16:44
 */
public class Demo01 {
    public static void main(String[] args)throws IOException {
        // Calendar instance = Calendar.getInstance();
        // System.out.println(instance.getTime());

        // DataInputStream in = new DataInputStream(new FileInputStream("1.txt"));

        // DataOutputStream out = new DataOutputStream(new FileOutputStream("1.txt"));



            // int i = in.readInt();
            // System.out.println(i);
            // double v = in.readDouble();
            // System.out.println(v);
            // in.close();

        OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream("1.txt"),"utf-8");
        InputStreamReader in = new InputStreamReader(new FileInputStream("1.txt"),"utf-8");

        out.write("hello");
        out.write(97);
        out.write("1");
        out.write("你好");
        out.close();

        char[] chars = new char[1024];
        int read = in.read(chars);
        System.out.println(String.valueOf(chars,0,read));
        System.out.println(1);


        in.close();
        // out.close();


    }
}
